<template>
	<view class="data-row" @click="clickRow">
		<view class="title">
			{{ title }}
		</view>
		<view class="content" :style="'color: ' + color + ';'">
			<image v-if="isImg" class="img" :src="content" mode=""></image>
			<text v-else>{{ content }}</text>
		</view>
		<uni-icons class="uni-icon" v-if="isArrow" type="arrowright" size="18" color="#999999"></uni-icons>
	</view>
</template>

<script>
	export default {
		name: 'DataRow',
		props: {
			isImg: {
				type: Boolean,
				default: false
			},
			color: {
				type: String,
				default: '#999999'
			},
			isArrow: {
				type: Boolean,
				default: false
			},
			title: String,
			content: String
		},
		data() {
			return {};
		},
		methods: {
			clickRow() {
				this.$emit('clickRow')
			}
		}
	}
</script>

<style lang="scss" scoped>
	::v-deep .uni-icons {
		position: absolute;
		right: 0;
	}
	.data-row {
		position: relative;
		
		display: flex;
		align-items: center;
		justify-content: space-between;
		
		height: 60px;
		padding-right: 80rpx;
		border-bottom: 1px solid #F8F8F8;
		.title {
			font-size: 14px;
			
			color: $uni-text-color;
		}
		.content {
			font-size: 12px;
			
			color: #999999;
			.img {
				height: 50px;
				width: 50px;
			}
		}
	}
</style>
